<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Modal</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: Arial, sans-serif;
            background-color: #f4f4f4;
        }

        .modal-container {
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
        }

        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.3);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 2;
        }

        .modal {
            background-color: #fff;
            padding: 20px;
            border-radius: 5px;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
            animation: modalFadeIn 0.3s ease-in-out;
            z-index: 100;
        }

        @keyframes modalFadeIn {
            from {
                opacity: 0;
                transform: translateY(-50px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .modal h2 {
            margin-bottom: 10px;
        }

        .modal p {
            margin-bottom: 20px;
        }

        .modal button {
            padding: 10px 20px;
            background-color: #0088cc;
            color: #fff;
            border: none;
            border-radius: 5px;
            cursor: pointer;
        }
    </style>
</head>

<body>
    <div class="modal-container">
        <div class="modal">
            <h2>Modal Title</h2>
            <p>This is the modal content. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
            <button onclick="closeModal()">Close</button>
        </div>
        <!-- <div class="modal-overlay" onclick="closeModal()"></div> -->
    </div>

    <script>
        function closeModal() {
            var modalContainer = document.querySelector('.modal-container');
            modalContainer.style.display = 'none';
        }
    </script>
</body>

</html>
